#!/usr/bin/python3
from PyQt5.QtCore import QBasicTimer
from PyQt5.QtWidgets import QProgressBar, QWidget

class IlerlemeCubugu(QWidget):
    def __init__(self, ebeveyn=None):
        super(IlerlemeCubugu, self).__init__(ebeveyn)

        self.pbar = QProgressBar(self)
        self.pbar.setGeometry(50, 50, 400, 25)

        self.timer = QBasicTimer()
        self.step = 0

    def timerEvent(self, e):
        if self.step >= 100:
            self.timer.stop()
            return

        self.step = self.step + 1
        self.pbar.setValue(self.step)

    def ilerleyici(self):
        if self.timer.isActive():
            self.timer.stop()
        else:
            self.timer.start(100, self)